import base64

import base64

image_path = r'.\0001.png'


def encode_pic(image_path, encryption_string, new_filename=None):
    with open(image_path, 'rb') as f:
        image = f.read()
        image_base64 = str(base64.b64encode(image), encoding='utf-8')
    sList = image_path.split('.')
    suffix = sList[len(sList) - 1].lower()
    base64String = "data:image/" + suffix + ";base64," + encryption_string
    base64String = base64String + image_base64
    with open(new_filename, 'wb') as f:
        f.write(base64String.encode('utf-8'))


# encode_pic(image_path, "111111111111111", ".\\0002.png")



import os
filePath = os.path.abspath('.')
filePath = '.'
for ml, cml, file in os.walk(filePath):
    if not file == []:
        for f in file:
            print("文件", ml + "\\" + f)


from queue import Queue
q = Queue(maxsize=0)
item = {'1': 1,
        '2': 2}
for i in range(10):
    q.put(i)
while not q.empty():
    print(q.get())
